package com.feihao.calendarTest;

import java.util.Calendar;
import java.util.Date;

public class CalendarTest {
    public static void main(String[] args) {
        //获取日历对象：
        Calendar c = Calendar.getInstance();

        //get()方法：

        int i = c.get(Calendar.MONTH);//注意：获取的月份从0-11！！！3---》代表4月分
        System.out.println(i);
        int year = c.get(Calendar.YEAR);
        System.out.println(year);

        //获取本月中的第几天
        int dayOdMonth = c.get(Calendar.DAY_OF_MONTH);
        System.out.println(dayOdMonth);

        //获取本月中的:
        int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
        System.out.println(dayOfWeek);

        /*Date time = c.getTime();
        System.out.println(time);*/



    }
}
